package com.kgc.storeprovider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.store.pojo.InStoreDetail;
import com.kgc.store.remote.InStoreDetailRemote;
import com.kgc.storeprovider.service.InStoreDetailService;
import com.kgc.storeprovider.service.InStoreService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class InStoreDetailController implements InStoreDetailRemote {

    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private InStoreDetailService inStoreDetailService;


    @Override
    public ResponseMsg getInStoreDetailList(String inStoreCode) {
        logger.info("InStoreDetailController getInStoreDetailList inStoreCode:"+inStoreCode);
        ResponseMsg msg = inStoreDetailService.getInStoreDetailList(inStoreCode);
        logger.debug("InStoreDetailController getInStoreDetailList inStoreCode:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg delInStoreDetail(Integer id) {
        logger.info("InStoreDetailController delInStoreDetail id:"+id);
        ResponseMsg msg = inStoreDetailService.delInStoreDetail(id);
        logger.debug("InStoreDetailController delInStoreDetail msg:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg addInStoreDetail(InStoreDetail inStoreDetail) {
        logger.info("InStoreDetailController addInStoreDetail inStoreDetail:"+inStoreDetail);
        ResponseMsg msg = inStoreDetailService.addInStoreDetail(inStoreDetail);
        logger.debug("InStoreDetailController addInStoreDetail msg:"+msg);
        return msg;
    }
}
